﻿<UserControl x:Class="Samba.Modules.TableModule.TableScreenView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
     xmlns:Common="clr-namespace:Samba.Presentation.Common;assembly=Samba.Presentation.Common" 
     xmlns:PropertyEditorLibrary="clr-namespace:PropertyTools.Wpf;assembly=PropertyTools.Wpf" 
     mc:Ignorable="d" d:DesignWidth="478">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="auto" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <ScrollViewer VerticalScrollBarVisibility="Auto">
            <StackPanel Grid.Row="0" Margin="0,0,20,0">
                <Label>
                    <LocText ResourceIdentifierKey="TableViewName" Suffix=":"/>
                </Label>
                <TextBox HorizontalAlignment="Left" MinWidth="250" Text="{Binding Name}" />
                <Label>
                    <LocText ResourceIdentifierKey="TableViewMode" Suffix=":"/>
                </Label>
                <ComboBox HorizontalAlignment="Left" MinWidth="150" SelectedItem="{Binding DisplayMode}"
                     ItemsSource="{Binding DisplayModes}" />
                <Label>
                    <LocText ResourceIdentifierKey="BackgroundColor" Suffix=":"/>
                </Label>
                <PropertyEditorLibrary:ColorPicker HorizontalAlignment="Left" MinWidth="200" SelectedColor="{Binding BackgroundColor}" />
                <Label>
                    <LocText ResourceIdentifierKey="BackgroundImage" Suffix=":"/>
                </Label>
                <TextBox HorizontalAlignment="Left" MinWidth="250" Text="{Binding BackgroundImage}" />
                <UniformGrid Columns="2">
                    <Label Margin="0,5,0,0">
                        <LocText ResourceIdentifierKey="EmptyTableColor" Suffix=":"/>
                    </Label>
                    <PropertyEditorLibrary:ColorPicker Margin="0,5,0,0" HorizontalAlignment="Left" MinWidth="150"
                         SelectedColor="{Binding TableEmptyColor}" />
                    <Label Margin="0,5,0,0">
                        <LocText ResourceIdentifierKey="UnavailableTableColor" Suffix=":"/>
                    </Label>
                    <PropertyEditorLibrary:ColorPicker Margin="0,5,0,0" HorizontalAlignment="Left" MinWidth="150"
                         SelectedColor="{Binding TableFullColor}" />
                    <Label Margin="0,5,0,0">
                        <LocText ResourceIdentifierKey="LockedTableColor" Suffix=":"/>
                    </Label>
                    <PropertyEditorLibrary:ColorPicker Margin="0,5,0,0" HorizontalAlignment="Left" MinWidth="150"
                         SelectedColor="{Binding TableLockedColor}" />
                    <Label Margin="0,5,0,0">
                        <LocText ResourceIdentifierKey="ColumnCount" Suffix=":"/>
                    </Label>
                    <Common:FilteredTextBox Type="Digits" Margin="0,5,0,0" HorizontalAlignment="Left"
                         MinWidth="50" Text="{Binding ColumnCount}" />
                    <Label Margin="0,5,0,0">
                        <LocText ResourceIdentifierKey="ButtonHeight" Suffix=":"/>
                    </Label>
                    <Common:FilteredTextBox Type="Digits" Margin="0,5,0,0" HorizontalAlignment="Left"
                         MinWidth="50" Text="{Binding ButtonHeight}" />
                    <Label Margin="0,5,0,0">
                        <LocText ResourceIdentifierKey=":PageCount" Suffix=":"/>
                    </Label>
                    <Common:FilteredTextBox Type="Digits" Margin="0,5,0,0" HorizontalAlignment="Left"
                         MinWidth="50" Text="{Binding PageCount}" />
                    <Label Margin="0,5,0,0">
                        <LocText ResourceIdentifierKey="NumeratorHeight" Suffix=":"/>
                    </Label>
                    <Common:FilteredTextBox Type="Digits" Margin="0,5,0,0" HorizontalAlignment="Left"
                         MinWidth="50" Text="{Binding NumeratorHeight}" />
                    <Label Margin="0,5,0,0">
                        <LocText ResourceIdentifierKey="AlphanumericButtons" Suffix=":"/>
                    </Label>
                    <TextBox Margin="0,5,0,0" HorizontalAlignment="Left" MinWidth="100" Text="{Binding AlphaButtonValues}" />
                </UniformGrid>
            </StackPanel>
        </ScrollViewer>
        <Grid Grid.Row="0" Margin="10,0,10,5" Grid.Column="1" Grid.RowSpan="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <StackPanel Grid.Row="0" Orientation="Horizontal">
                <Label>
                    <LocText ResourceIdentifierKey="Tables" Suffix=":"/>
                </Label>
                <TextBlock Margin="2,5">
                    <Hyperlink Command="{Binding SelectTablesCommand}">
                        <TextBlock Text="{Binding Path=SelectTablesCommand.Caption}" />
                    </Hyperlink>
                </TextBlock>
            </StackPanel>
            <Border Grid.Row="1" VerticalAlignment="Stretch" BorderBrush="{StaticResource {x:Static SystemColors.ActiveBorderBrushKey}}"
                 BorderThickness="1">
                <ScrollViewer VerticalScrollBarVisibility="Auto">
                    <ListBox ItemsSource="{Binding ScreenItems}" DisplayMemberPath="Name" MinHeight="150"
                         MinWidth="150" BorderThickness="0" />
                </ScrollViewer>
            </Border>
        </Grid>
        <StackPanel Grid.Row="1" Grid.ColumnSpan="2">
            <Button HorizontalAlignment="Left" Margin="0,10" MinWidth="70" Content="{Binding SaveCommand.Caption}"
                 Command="{Binding SaveCommand}" />
            <Label Content="{Binding Error}" Foreground="Red" />
        </StackPanel>
    </Grid>
</UserControl>